<template>
  <div class="echarts" ref="echarts"></div>
</template>

<script>
import * as echarts from 'echarts'
import resize from '@/mixins/resize'
export default {
  name: 'ReBarChart',
  mounted() {
    this.myEcharts = echarts.init(this.$refs.echarts)
    this.myEcharts.setOption({
      xAxis: {
        show: false,
        boundaryGap: true,
        min: 0,
        max: 100
      },
      yAxis: {
        type: 'category',
        show: false
      },
      series: [
        {
          type: 'bar',
          smooth: true,
          data: [78],
          barWidth: 10,
          showBackground: true,
          backgroudStyle: {
            color: 'rgba(0,0,0,0.1)'
          },
          itemStyle: {
            color: '#E74E5C'
          }
        }
      ],
      label: {
        show: true,
        position: 'right',
        formatter: '|'
      },
      grid: {
        left: 0,
        right: 0,
        top: 0,
        bottom: 0
      }
    })
  },
  mixins: [resize]
}
</script>

<style lang="scss">
.echarts {
  width: 100%;
  height: 50px;
}
</style>
